using System.ComponentModel.DataAnnotations;
using FytSoa.Domain.Hr;
using SqlSugar;

namespace FytSoa.Domain.Erp;

/// <summary>
/// erp-产品报废单据表
/// </summary>
[SugarTable("erp_scrap")]
public class ErpScrap:Entity
{
    /// <summary>
    /// 报废原因
    /// </summary>
    [Required]
    [StringLength(100)]
    public string Title { get; set; }

    /// <summary>
    /// 负责人
    /// </summary>
    [Required]
    public long ChargePersonId { get; set; } = 0;
    
    /// <summary>
    /// 负责人
    /// </summary>
    [Navigate(NavigateType.OneToOne, nameof(ChargePersonId))]
    public HrEmployee Employee { get; set; }

    /// <summary>
    /// 执行状态
    /// </summary>
    public bool Status { get; set; } = false;

    /// <summary>
    /// 创建人
    /// </summary>
    public string CreateUser { get; set; }

    /// <summary>
    /// 创建时间
    /// </summary>
    [Required]
    public DateTime CreateTime { get; set; } = DateTime.Now;

    /// <summary>
    /// 更新人
    /// </summary>
    public string UpdateUser { get; set; }

    /// <summary>
    /// 更新时间
    /// </summary>
    public DateTime? UpdateTime { get; set; }


}